package com.example.stream;

import java.util.Arrays;
import java.util.stream.Stream;

public class OfDemo {
    public static void main(String[] args) {
        //流的构建
        Stream<String> stream = Stream.of("1", "2", "3");
        stream.forEach(v-> System.out.println(v));

        Stream<Object> objectStream = Stream.of("2", true, new Student(1, "a", 36, "M"));
        objectStream.forEach(v-> System.out.println(v));

        Integer[] integers = {1, 3, 6, 2};
        Stream<Integer> stream1 = Arrays.stream(integers);
        stream1.forEach(v-> System.out.println(v));

    }
}
